{template('../public/header.html')}

    <form name="searchform" method="get" >
    <table width="100%" cellspacing="0" class="search_form">
        <tbody>
            <tr>
            <td>
            <div class="explain_col">
            	<input type="hidden" name="m" value="admin" />
                <input type="hidden" name="c" value="class" />
                <input type="hidden" name="a" value="index" />
                <input type="hidden" name="menuid" value="{$menuid}" />
				所属模型：
                <select name="module_id">
					<option value="">--请选择模型--</option>
					{$module_list type='rs'}
						<option value="{$module_list("id")}" {if module_id=CLng(module_list("id"))} style="background:#92C2D9"  selected="selected" {/if}>{$module_list("title")}</option>
					{/$module_list}
                </select>&nbsp;
				类型：
                <select name="typeid">
					<option value="">--栏目类型--</option>
					<option value="0" {if Req("typeid")<>"" And Req("typeid")=0} style="background:#92C2D9" selected="selected" {/if}>普通分类</option>
					<option value="1" {if Req("typeid")=1} style="background:#92C2D9" selected="selected" {/if}>单页面</option>
                </select>&nbsp;
                <input type="submit" name="search" class="btn" value="检索" />
        	</div>
            </td>
            </tr>
        </tbody>
    </table>
    </form>

<!--栏目列表-->
<div class="pad_10">
    <div class="J_tablelist table_list" data-acturi="{:U('class/ajax_edit')}">
    <table width="100%" cellspacing="0" id="J_cate_tree">
        <thead>
            <tr>
                <th width="30"><input type="checkbox" name="checkall" class="J_checkall"></th>
              	<th align="left">栏目名称</th>
                <th width="60"><span data-tdtype="order_by" data-field="id">ID</span></th>
				<th width="60">所属模型</th>
				<th width="60">栏目类型</th>
				<th width="100">栏目图片</th>
              	<th width="80"><span data-tdtype="order_by" data-field="ordid">{:L('sort_order')}</span></th>
                <th width="60"><span data-tdtype="order_by" data-field="status">{:L('status')}</span></th>
                <th width="150">{:L('operations_manage')}</th>
            </tr>
        </thead>
    	<tbody>
		{foreach e cat}
			<tr id='node-{:cat(e)("id")}' {if cat(e)("pid")>0}class="child-of-node-{:cat(e)("pid")}"{else} {/if}>
                <td align='center'><input type='checkbox' value='{:cat(e)("id")}' class='J_checkitem'></td>
                <td>{:cat(e)("tree_spacer")}<span data-tdtype='edit' data-field='name' data-id='{:cat(e)("id")}' class='tdedit'>{:cat(e)("name")}</span></td>
                <td align='center'>{:cat(e)("id")}</td>
                <td align='center'>{:moduleName(cat(e)("module_id"))}</td>
                <td align='center'>{if cat(e)("typeid")=1}<span class="blue">单页面</span>{else}普通分类{/if}</td>
                <td align='center'>{if not ab.c.isnul(cat(e)("img"))}<div class="img_border"><img src="{:cat(e)("img")}" width="26" height="26" class="J_preview" data-bimg="{:cat(e)("img")}"/></div>{else}&nbsp;{/if}</td>
                <td align='center'><span data-tdtype='edit' data-field='ordid' data-id='{:cat(e)("id")}' class='tdedit'>{:cat(e)("ordid")}</span></td>
                <td align='center'><img data-tdtype="toggle" data-id="{:cat(e)("id")}" data-field="status" data-value="{:cat(e)("status")}" src="__STATIC__/images/admin/toggle_{if cat(e)("status")=1}enabled{else}disabled{/if}.gif" /></td>
                <td align='center'>
					<a href="javascript:;" class="J_showdialog" data-uri="{:U('class/add?pid='& cat(e)("id"))}" data-title="添加栏目" data-id="add" data-width="500" data-height="380">添加子栏目</a> |
					<a href="javascript:;" class="J_showdialog" data-uri="{:U('class/edit?id='& cat(e)("id"))}" data-title="{:L('edit')} - {:cat(e)("name")}" data-id="edit" data-width="500" data-height="380">{:L('edit')}</a> |
					<a href="javascript:;" data-acttype="ajax" class="J_confirmurl" data-uri="{:U('class/delete?id='& cat(e)("id"))}" data-msg='确定要删除“<font color=blue>{:cat(e)("name")}</font>”吗？'>{:L('delete')}</a></td>
			</tr>
		{/foreach}
    	</tbody>
    </table>
    </div>
    <div class="btn_wrap_fixed">
        <label class="select_all"><input type="checkbox" name="checkall" class="J_checkall">{:L('select_all')}/{:L('cancel')}</label>
        <input type="button" class="btn" data-tdtype="batch_action" data-acttype="ajax" data-uri="{:U('class/delete')}" data-name="id" data-msg="{:L('confirm_delete')}" value="{:L('delete')}" />
    </div>
</div>
{template('../public/footer.html')}
<script src="__STATIC__/js/jquery/plugins/jquery.treetable.js"></script>
<script>
$(function(){
    //initialState:'expanded'
    $("#J_cate_tree").treeTable({indent:20,treeColumn:1});
});
</script>
</body>
</html>